home *** CD-ROM | disk | FTP | other *** search
/ Super PC 34 / Super PC 34 (Shareware).iso / spc / UTIL / DJGPP2 / CONTRIB / MAN_PC.ZIP / man_pc / man / makefile next >
Encoding:
Makefile  |  1995-06-20  |  3.5 KB  |  160 lines

  1. # makefile for man
  2. #
  3. # date:    Sat Jan 19 04:08:46 1991
  4. # version: 2.0
  5. #
  6. #
  7.  
  8. # set this to executable file extension, if necessary (eg, .exe for MSDOS,
  9. # .ttp for atari)
  10. #
  11. EXE        =
  12.  
  13. SECT        = 1
  14. TARGET        = man$(EXE)
  15. MANPAGE        = man.$(SECT)
  16. MANSRC        = man.man
  17. HEADERS        =
  18. SRCS        = $(HEADERS) man.c
  19. OTHERS        = readme makefile $(MANSRC)
  20. DISTFILES    = $(OTHERS) $(SRCS)
  21. OBJS        = man.o
  22.  
  23.  
  24. # set CC to the command needed to compile a file (to a .o file).
  25. # set LD to the command needed to link .o files.
  26. #
  27. #CC        = gcc -v -z -Wall -Ic:/u/gcc/include
  28. #LD        = gcc -v -z -Wall -Lc:/u/gcc/lib -nostdlib c:/u/gcc/lib/crt0.o
  29. CC        = cc -Aa
  30. LD        = cc -Aa
  31.  
  32.  
  33. # defines based on what you have:
  34. #    -DHAS_CAT    yes, i have cat$(EXE)
  35. #    -DHAS_UL    yes, i have ul$(EXE)
  36. #    -DHAS_WHATIS    yes, i have whatis$(EXE)
  37. #    -DHAS_APROPOS    yes, i have apropos$(EXE)
  38. #    -DLONG_SECT    use longer list for things like "local"
  39. #    -DUSE_INDEX    if you need index/rindex instead of strchr/strrchr
  40. #    -Datarist    for Atari ST
  41. #    -DMSDOS        for PC
  42. #    -Dunix        for unix systems (or unix-like)
  43. #
  44. DEFS        = -DHAS_CAT -DHAS_UL -DHAS_WHATIS -DHAS_APROPOS -DLONG_SECT
  45.  
  46.  
  47. # set ARCH for things like -mshort.
  48. # set OPT potentially to -O.
  49. # set libs to list of libraries needed in link (eg, -lc).
  50. #
  51. ARCH        =
  52. OPT        =
  53. CFLAGS        = $(ARCH) $(OPT) $(DEFS) 
  54. LDFLAGS        = $(ARCH)
  55. LIBS        =
  56.  
  57. # set BINDIR to the place where you want the executable installed.
  58. # set MANDIR to the place where man's manpage will be installed (the
  59. # directory must exist; consider doing "make dirs" before "make install")
  60. # include a trailing / (or \) for both BINDIR and MANDIR.
  61. #
  62. #SLASH        =\\
  63. #BINDIR        = c:\usr\bin
  64. #MANTOP        = c:\usr\man
  65. #MANDIR        = $(MANTOP)$(SLASH)man$(SECT)
  66. #CATDIR        = $(MANTOP)$(SLASH)cat$(SECT)
  67. SLASH        =/
  68. BINDIR        = /mnt/rosenkra/test/bin
  69. MANTOP        = /mnt/rosenkra/test/man
  70. MANDIR        = $(MANTOP)$(SLASH)man$(SECT)
  71. CATDIR        = $(MANTOP)$(SLASH)cat$(SECT)
  72.  
  73. # install commands
  74. #
  75. INST_BIN    = cp -p
  76. INST_MAN    = cp -p
  77.  
  78. RM        = rm -f
  79.  
  80.  
  81. # directions...
  82. #
  83. directions:
  84.         @echo type "make all" to built $(TARGET)
  85.         @echo type "make dirs" to create $(MANDIR) directories
  86.         @echo type "make install" to build/install $(TARGET)
  87.         @echo type "make clean" to remove objects
  88.         @echo type "make clobber" to remove objects and $(TARGET)
  89.         @echo these should be done in this order
  90.  
  91.  
  92. # main target...
  93. #
  94. all:        $(TARGET)
  95.  
  96. $(TARGET):    $(OBJS)
  97.         $(LD) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
  98.  
  99.  
  100.  
  101. # manpage (use built-in .man.cat rule)...
  102. #
  103. manpage:    $(MANPAGE)
  104.  
  105. $(MANPAGE):    $(MANSRC)
  106.         nroff -man $(MANSRC)|ul -t dumb|cat -s >$(MANPAGE)
  107.  
  108.  
  109.  
  110.  
  111. # create directories
  112. #
  113. dirs:        install_dirs
  114.  
  115. install_dirs:
  116.         mkdir $(MANTOP)
  117.         mkdir $(MANTOP)$(SLASH)cat0 $(MANTOP)$(SLASH)man0
  118.         mkdir $(MANTOP)$(SLASH)cat1 $(MANTOP)$(SLASH)man1
  119.         mkdir $(MANTOP)$(SLASH)cat2 $(MANTOP)$(SLASH)man2
  120.         mkdir $(MANTOP)$(SLASH)cat3 $(MANTOP)$(SLASH)man3
  121.         mkdir $(MANTOP)$(SLASH)cat4 $(MANTOP)$(SLASH)man4
  122.         mkdir $(MANTOP)$(SLASH)cat5 $(MANTOP)$(SLASH)man5
  123.         mkdir $(MANTOP)$(SLASH)cat6 $(MANTOP)$(SLASH)man6
  124.         mkdir $(MANTOP)$(SLASH)cat7 $(MANTOP)$(SLASH)man7
  125.         mkdir $(MANTOP)$(SLASH)cat8 $(MANTOP)$(SLASH)man8
  126.         mkdir $(MANTOP)$(SLASH)cat9 $(MANTOP)$(SLASH)man9
  127.         touch install_dirs
  128.  
  129.  
  130. # to install it...
  131. #
  132. install:    install_dirs install_bin install_man
  133.  
  134. install_bin:    $(TARGET)
  135.         $(INST_BIN) $(TARGET) $(BINDIR)$(SLASH)$(TARGET)
  136.         touch install_bin
  137.  
  138. install_man:    $(MANPAGE)
  139.         $(INST_MAN) $(MANSRC) $(MANDIR)$(SLASH)$(MANPAGE)
  140.         $(INST_MAN) $(MANPAGE) $(CATDIR)$(SLASH)$(MANPAGE)
  141.         touch install_man
  142.  
  143.  
  144.  
  145. # others...
  146. #
  147. clean:
  148.         $(RM) core $(OBJS) errs
  149.  
  150. clobber:    clean
  151.         $(RM) $(TARGET)
  152.  
  153.  
  154.  
  155.  
  156. # dependencies...
  157. #
  158. man.o:        man.c 
  159.  
  160.